﻿<!--*************************************************************************************

   Toolkit for WPF

   Copyright (C) 2007-2016 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license 

   For more features, controls, and fast professional support,
   pick up the Plus Edition at https://xceed.com/xceed-toolkit-plus-for-wpf/

   Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids

  ***********************************************************************************-->
<local:DemoView x:Class="Xceed.Wpf.Toolkit.LiveExplorer.Samples.Button.Views.DropDownSplitButtonView"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:local="clr-namespace:Xceed.Wpf.Toolkit.LiveExplorer"
                xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
                xmlns:sys="clr-namespace:System;assembly=mscorlib"
                Title="DropDown and Split Buttons">
    <local:DemoView.Description>
        <Paragraph FontSize="14" FontFamily="Segoe">
            <Run>The DropDownButton control is a button that when clicked displays a drop down in which you can place any custom content within.</Run>
            <LineBreak />
            <LineBreak />
            <Run>The SplitButton control is a button that can be clicked and also provides a drop down in which you can place any custom content within.</Run>
        </Paragraph>
    </local:DemoView.Description>
   <local:DemoView.Resources>
      <ObjectDataProvider x:Key="DropDownPlacementMode"
                          MethodName="GetValues"
                          ObjectType="{x:Type sys:Enum}">
         <ObjectDataProvider.MethodParameters>
            <x:Type TypeName="PlacementMode" />
         </ObjectDataProvider.MethodParameters>
      </ObjectDataProvider>
   </local:DemoView.Resources>

   <Grid>
      <StackPanel Margin="10">

         <GroupBox Header="Features"
                   Margin="0,5,0,5">
            <Grid Margin="5">
               <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto" />
                  <ColumnDefinition Width="Auto" />
               </Grid.ColumnDefinitions>

               <Grid.RowDefinitions>
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
               </Grid.RowDefinitions>

               <TextBlock Text="MaxDropDownHeight:"
                          VerticalAlignment="Center"/>
               <xctk:DoubleUpDown x:Name="maxDropDownHeight"
                                  Grid.Column="1"
                                  Width="60"
                                  Value="500"
                                  AllowInputSpecialValues="PositiveInfinity"
                                  Minimum="0"
                                  VerticalAlignment="Center"
                                  Margin="5"/>

               <TextBlock Text="DropDown Position: "
                          Grid.Row="1"
                          VerticalAlignment="Center" />
               <ComboBox x:Name="dropDownPosition"
                         Grid.Column="1"
                         Grid.Row="1"
                         ItemsSource="{Binding Source={StaticResource DropDownPlacementMode}}"
                         SelectedIndex="2"
                         HorizontalAlignment="Left"
                         Width="110"
                         VerticalAlignment="Center"
                         Margin="5" />
            </Grid>
         </GroupBox>

         <StackPanel>
            <TextBlock Text="Usage:"
                       Style="{StaticResource Header}" />

            <Grid>
               <Grid.RowDefinitions>
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
               </Grid.RowDefinitions>
               <Grid.ColumnDefinitions>
                  <ColumnDefinition />
                  <ColumnDefinition />
               </Grid.ColumnDefinitions>

               <TextBlock Text="DropDownButton Usage:"
                          Style="{StaticResource Header}" />
               <xctk:DropDownButton x:Name="_dropDownButton"
                                    Grid.Row="1"
                                    Margin="10"
                                    Width="150"
                                    HorizontalAlignment="Left"
                                    Content="Click Me"
                                    MaxDropDownHeight="{Binding Value, ElementName=maxDropDownHeight}"
                                    DropDownPosition="{Binding SelectedItem, ElementName=dropDownPosition}"
                                    Click="DropDownButton_Click">
                  <xctk:DropDownButton.DropDownContent>
                     <StackPanel>
                        <xctk:ColorCanvas />
                        <Button Click="Button_Click"
                                Margin="10">OK</Button>
                     </StackPanel>
                  </xctk:DropDownButton.DropDownContent>
               </xctk:DropDownButton>

               <TextBlock Text="SplitButton Usage:"
                          Grid.Column="1"
                          Style="{StaticResource Header}" />
               <xctk:SplitButton x:Name="_splitButton"
                                 Grid.Row="1"
                                 Grid.Column="1"
                                 Margin="10"
                                 Width="150"
                                 HorizontalAlignment="Left"
                                 Content="Click Me"
                                 MaxDropDownHeight="{Binding Value, ElementName=maxDropDownHeight}"
                                 DropDownPosition="{Binding SelectedItem, ElementName=dropDownPosition}"
                                 Click="SplitButton_Click">
                  <xctk:SplitButton.DropDownContent>
                     <StackPanel>
                        <xctk:ColorCanvas />
                        <Button Click="Button_Click"
                                Margin="10">OK</Button>
                     </StackPanel>
                  </xctk:SplitButton.DropDownContent>
               </xctk:SplitButton>
            </Grid>
         </StackPanel>
      </StackPanel>
   </Grid>

</local:DemoView>
